<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="common/header.jsp" %>	
<div class="clearfix"></div>
<div class="row">
  <div class="col-md-12 col-sm-12 col-xs-12">
    <div class="x_panel">
      <div class="x_title">
        <h2>添加学生信息 <i class="fa fa-user"></i></h2>
             <div class="clearfix"></div>
      </div>
      <div class="x_content">
        <form class="form-horizontal form-label-left" action="saveStudent.html" method="post" enctype="multipart/form-data">
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">姓名 <span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input id="softwareName" class="form-control col-md-7 col-xs-12" 
               data-validate-length-range="20" data-validate-words="1" 
               name="studentName" value="" required="required"
               placeholder="请输入姓名" type="text">
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="select">性别<span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12" >
            	<input type="radio" name="sex" value="1" required="required">男&emsp;&emsp;&emsp;
            	<input type="radio" name="sex" value="2" required="required">女
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">年龄 <span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input id="sex" type="text" class="form-control col-md-7 col-xs-12" 
              placeholder="请输入年龄" name="age" value="" required="required">
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">电话 <span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input id="supportROM" class="form-control col-md-7 col-xs-12" 
              	name="phone" value="" required="required"
              	data-validate-length-range="20" data-validate-words="1" 
              	placeholder="请输入电话号码" type="text">
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">现今住址<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input id="interfaceLanguage" class="form-control col-md-7 col-xs-12" 
              data-validate-length-range="20" data-validate-words="1"  required="required"
              name="address" value=""
              placeholder="请输入住址" type="text">
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="number">身份证号<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="identityCard" name="identityCard" value="" required="required"
              data-validate-minmax="10,500"  placeholder="请输身份证号" class="form-control col-md-7 col-xs-12">
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="number">出生日期 <span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="date" id="downloads" name="birthday" value="" required="required"
               placeholder="请输入出生日期" class="form-control col-md-7 col-xs-12">
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="select">课程 <span class="required">*</span></label>
            <div class="col-md-2 col-sm-3 col-xs-12">
            	<select name="subject" id="subject" class="form-control col-md-7 col-xs-12" required="required">
            		<option value="">请选择课程</option>
            		<c:forEach var="subject" items="${subjectList}">
            			<option value="${subject.id}">${subject.subjectName}</option>
            		</c:forEach>
            	</select>
            </div>
            <label class="control-label col-md-2 col-sm-3 col-xs-12"  for="select">班级<span class="required">*</span></label>
            <div class="col-md-2 col-sm-3 col-xs-12">
            	<select name="gradeId" id="grade" class="form-control col-md-7 col-xs-12" required="required">
            		 <option value="">请选择班级</option>
            	</select>
            </div>
          </div>
           <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="select">学历<span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="downloads" name="educationBackground" value="" placeholder="请输入学历"
               class="form-control col-md-7 col-xs-12" required="required">
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="select">计算机了解程度<span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
            	<input type="radio" name="computerSavvy" value="0" required="required">零基础&emsp;&emsp;&emsp;
            	<input type="radio" name="computerSavvy" value="1" required="required">一般&emsp;&emsp;&emsp;
            	<input type="radio" name="computerSavvy" value="2" required="required">资深&emsp;&emsp;&emsp;
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="select">咨询师<span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="downloads" name="counselorName" value="${user.name}" readonly="readonly" class="form-control col-md-7 col-xs-12">
              <input type="hidden" name="counselor" value="${user.id}">
            </div>
          </div>
          <div class="item form-group">
           	<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">备注<span class="required">*</span>
            </label>
             <div class="col-md-6 col-sm-6 col-xs-12">
             	<textarea id="mam" name="content" style="height: 100px; width: 450px;"></textarea> 
             </div>
          </div> 
          <!-- <div class="item form-group">
          	<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">身份证正面照片<span class="required">*</span>
            </label>
          	<div class="col-md-6 col-sm-6 col-xs-12">
				<div id="uploadfile">
				<input id="attach" type="file" name="attach">
				<p><span style="color:red;font-weight: bold;">*注：1、大小不得超过500k.2、图片格式：jpg、png、jpeg、pneg</span></p>
				</div>
				<div id="logoFile"></div>
          	</div>
          </div> -->
          <!-- <div class="item form-group">
          	<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">身份证反面照片<span class="required">*</span>
            </label>
          	<div class="col-md-6 col-sm-6 col-xs-12">
				<div id="uploadfile">
				<input id="attach" type="file" name="attach">
				<p><span style="color:red;font-weight: bold;">*注：1、大小不得超过500k.2、图片格式：jpg、png、jpeg、pneg</span></p>
				</div>
				<div id="logoFile"></div>
          	</div>
          </div> -->
          <div class="form-group">
            <div class="col-md-6 col-md-offset-3">
              <input id="send" type="submit" class="btn btn-success" value="保存"/>
              <button type="button" class="btn btn-primary" id="back">返回</button>
              <br/><br/>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/bdqnFoledr/statics/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
	$(function(){
		function selectGrade(){
			var subjectId = $("#subject");
     		$.ajax({
			   type:"GET",
			   url:"/ApplySystem/user/getGradeBySubjectId.json",
			   data: {subjectId:subjectId.val()},
			   dataType : "json",
			   scriptCharset: "UTF-8",
			   success:function(data){
			   		$("#grade").html("");
					var options = "<option value=\"\">请选择班级</option>";
					for(var i = 0; i < data.result.length; i++){
						options += "<option value=\""+data.result[i].id+"\">"+data.result[i].gradeName+"</option>";
					}
					$("#grade").html(options);
			   },
			   error:function(data){
			   		alert("请求异常");
			   }
			});
      	}
		$("#subject").change(selectGrade);
	});
</script>

<%@ include file="common/footer.jsp" %>
